﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BabyFood.Entities;
using BabyFood.Data;

public partial class Controls_ControlSachMod : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HienThiSachHay();
        }
    }

    private void HienThiSachHay()
    {
        int TotalRows = 0;
        TList<SachHay> TList_SachHay = DataRepository.SachHayProvider.GetPaged("TrangThai=1", "NgayCapNhat DESC", 0, 4, out TotalRows);

        dlSachHay.DataSource = TList_SachHay;
        dlSachHay.DataBind();
    }

    public string GetLienKet(object LienKet)
    {
        //if (Session["KhachHangVip"] != null)
        //{
            return Server.HtmlDecode(LienKet.ToString());
        //}
        //else
        //    return "../DangNhap.aspx";
    }

    public string GetTieuDe(object Char)
    {
        string s = Char.ToString();
        return Common.ConvertToUnSign(s);
    }
}